package com.ym.b2b.ws.client;

import java.net.MalformedURLException;

import javax.xml.namespace.QName;

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

import com.ym.b2b.product.sqlbean.EmBProduct;
import com.ym.b2b.ws.service.ProductWebService;

public class TestClient {

    private static final QName  SERVICE_NAME  = new QName("http://service.ws.b2b.ym.com/", "ProductWebServiceService");

    private static final String WSDL_LOCATION = "http://localhost:8080/admin/ws/product?wsdl";

    public static void main(String[] args) throws MalformedURLException {
        try {
            JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean();

            factoryBean.setServiceClass(ProductWebService.class);

            factoryBean.setAddress("http://222.175.99.202:1800/admin/ws/product");

            ProductWebService readerService = (ProductWebService) factoryBean.create();
            EmBProduct reader = readerService.getProductDetailForJosn("11040691");
            System.out.println("Reader:" + reader.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
